package com.sh.data.engine.domain.datadev.flink.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.sh.data.engine.domain.datadev.flink.model.domain.*;
import com.sh.data.engine.domain.datadev.flink.model.param.SaveTaskNodeParam;
import com.sh.data.engine.repository.dao.datadev.entity.FlinkMenuNodeEntity;

import java.util.List;

/**
 * @author binghe.yxh
 */
public interface FlinkNodeService extends IService<FlinkMenuNodeEntity> {

    Boolean saveNode(FlinkNodeBaseDomain domain, Long projectId, String userId);

    List<FlinkNodeDomain> getAllNodes(Integer type, Long projectId);

    FlinkNodeDomain getFinkNodeById(Long id);

    Long saveNode(SaveTaskNodeParam param);

    void deleteNode(Long id, Long projectId);

    List<FlinkDirTreeDomain> getDirNodes(Integer type, Long projectId);

    Long saveFunctionNode(FlinkNodeFunctionDomain domain);

    boolean existSameFunctionNode(Long id, String name, Long projectId);

    List<FlinkNodeConfigResourceDomain> getAllActiveResource(Long projectId);

    List<FlinkMenuSimpleDomain> getFlinkMenuSimpleList(Long projectId);

    boolean changeNodeDir(Long id, Long pid);

    Integer getNextSort(Long projectId, Long pid);

    boolean changeNodeSort(Long id, Long siblingsId, Integer dropPosition);

    boolean existSameNode(Long id, String name, Long pid, Long projectId);

    List<FlinkResourceListDomain> getResourceByProjectId(Long projectId);

    Boolean lockNode(Long id, Integer isLocked);

    Boolean publish(Long id, Integer status, String userId);

    List<FlinkNodeDomain> getListByPage(Long projectId, Integer pageSize, Integer pageNum);

    Boolean hasSameMenuNode(Long nodeId, Long pid, Long projectId, String resourceName, int code);
}
